<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function f(n) {
        if (n === 10) {
          return 1;
        } else {
          return (f(n + 1) + 1) * 2;
        }
      }
      console.log(f(1));
    </script>
  </body>
</html>
